//
//  LoginController.m
//  Village
//
//  Created by 程虎 on 2017/9/12.
//  Copyright © 2017年 程虎. All rights reserved.
//

#import "LoginController.h"
#import "LoginView.h"
#import "MineController.h"
@interface LoginController ()<TestViewDelegate>
@property (nonatomic, strong) LoginView *loginViews;
@property (nonatomic, copy) LongriseRouterBlock routerBlock;
@end

@implementation LoginController
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    self.navigationController.navigationBar.hidden = NO;
}

-(void)goToController
{
    UIViewController *viewCtl = self.navigationController.viewControllers[0];
    [self.navigationController popToViewController:viewCtl animated:YES];
}

- (void)viewDidLoad {
    
    [super viewDidLoad];
    self.view.backgroundColor = kBackgroundColor;
    self.loginViews = [[LoginView alloc] initWithShowVC:self];
    self.loginViews.delegate = self;
    [self.view addSubview:self.loginViews];
    self.loginViews.sd_layout.spaceToSuperView(UIEdgeInsetsZero);
    WeakSelf(weakSelf);
    self.loginViews.loginBlock = ^{
        if (weakSelf.routerBlock) {
            weakSelf.routerBlock([Globle getInstance].account);
        }
    };
}

- (void)setParams:(id)obj block:(LongriseRouterBlock)block
{
    self.routerBlock = block;
}
@end
